﻿using System.Collections.Generic;
using System.IO;
using System.Web;

namespace WebDiagnostics
{
    public class AjaxResponseRenderer : IDiagnosticsResponseRenderer
    {
        private readonly HttpContextBase _context;
        private readonly IEnumerable<Diagnosis> _diagnoses;

        public AjaxResponseRenderer(HttpContextBase context, IEnumerable<Diagnosis> diagnoses)
        {
            _context = context;
            _diagnoses = diagnoses;
        }

        public void Render(TextWriter writer)
        {
            foreach (var diagnosis in _diagnoses)
            {
                diagnosis.Render(writer);
            }
        }
    }
}